<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category   design_blank
 * @package    Mage
 * @copyright  Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
 * @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */

/*
 * Created by Contussupport
 * www.contussupport.com
*/
?>
<?php
$storeName =Mage::getStoreConfig('general/store_information/name');

$currencySymbol = Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol();
$select = "";
$cities = array();
$attribute = Mage::getModel('eav/config')->getAttribute('catalog_product', '548'); // get the cities attribute id 548

// to get the multiple cities in pages(drop down)
foreach ($attribute->getSource()->getAllOptions(true, true) as $option) {
    $value = $option['value'];
    if($value !='') {
        $cities[$value] = $option['label'];
        $select .= "<option value='".$option['label']."'>". $option['label']."</option>";
    }
}
$final=array_unique($cities);
Mage::getSingleton('core/session')->setTotalCities($final);
Mage::getSingleton('core/session')->setCitydropdown($select);

if(Mage::getSingleton('core/session')->getBackground() == 'no'){
    $style = "background:#343434;";
}else{
    $style ="";
}
?>
<!--MORE CITIES TOP MENU STARTS HERE-->
<div class="topmenubg">
    <div id="toggle_blind" style="display:none;">
        <div class='container_16 clearfix' id='drawer_inner'>
            <div class='grid_16 last'>
                <div id='division_drawer'>
                    <ul class='clearfix' id='division_list1'>
                        <?php foreach($final as $key=>$city): if($city!=""):?>
                        <li>
                            <a href="<?php echo Mage::getBaseUrl().str_replace(' ','+',$city); ?>"><?php echo strtoupper($city); ?></a>
                        </li>
                            <?php endif ;
                        endforeach; ?>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>
<!--MORE CITIES TOP MENU ENDS HERE-->
<div class="clsbg " style="<?php echo $style; ?>">
    <div class="header clearfix">

            <!--Logo starts-->
            <div class="clslogo" >
                <a onclick="location.href='<?php echo $this->getUrl('') ?>'"><img src="<?php echo $this->getSkinUrl('images/logo.png') ?>" width="291" height="36" alt="<?php echo $this->__($storeName); ?>" title="<?php echo $this->__($storeName); ?>" /></a>
                <div class="city_name">
                    <span class="clsbestdeal"><?php echo $this->__('Daily Deals On the Best in'); ?></span>
                    <h4><?php echo $final[Mage::getSingleton('core/session')->getCity()]; ?></h4>
                </div>
            </div>
            <!--Logo Ends-->

            <!-- Cities panel starts-->
            <div class="floatright" >
                <img src="<?php echo $this->getSkinUrl('images/cityleft.png') ?>" class="floatleft" alt="More Cities" title="More Cities"/><div class="city_middle">
                    <ul class='toggles'>
                        <li class='drawer_toggle' id='division_drawer_anchor'>
                            <a href="#" onclick="Effect.toggle('toggle_blind', 'blind',{  duration: 0.1 }); return false;" class="clsmore ">
                                <span class="clsmore"><?php echo $this->__('Visit More Cities'); ?></span>
                                <img src="<?php echo $this->getSkinUrl('images/nc.png') ?>" id="image1" class="clsvisitmorimg"  alt="cities" />
                            </a></li><li><img src="<?php echo $this->getSkinUrl('images/citydivider.jpg') ?>" alt="More Cities" title="More Cities" /></li>
                        <?php echo $this->getChildHtml('topLinks'); ?>
                        <li><a href="<?php echo $this->getUrl("contacts"); ?>"><?php echo $this->__('Contact us'); ?></a></li></ul></div>
                <img src="<?php echo $this->getSkinUrl('images/cityright.png')?>" class="floatleft" alt="More Cities" title="More Cities" />
           </div>
           <!-- Cities panel End-->
        
           
             <div class="clearright"></div>

            <!-- subscriber panel starts-->
            <div class="clsmailing" >
                <form action="<?php echo $this->getUrl('newsletter/subscriber/new') ?>" method="post" id="newsletter-validate-detail">

                    <div class="clearfix">
                        <div class="searchinput" >
                            <input name="email" type="text" id="newsletter1" class="searchinput1 validate-email required-entry" value="<?php echo $this->__('Enter your email address here...') ;?>" onfocus="if (this.value == '<?php echo $this->__('Enter your email address here...') ;?>') {this.value = '';this.style.color ='black';}" onblur="if (this.value == '') {this.style.color ='black';this.value = '<?php echo $this->__('Enter your email address here...') ;?>';}"  /></div>
                        <div class="selectcity"><select id="city" name="city"  class="select select input-text required-entry">
                                <option value=""><?php echo $this->__('Select your City') ;?></option>
                                <?php echo $select; ?>               </select>
                        </div>
                        <input type="submit"   value="<?php echo $this->__('Subscribe') ;?>" class="mailing_button"/></div>

                </form>
                <script type="text/javascript">
                    //<![CDATA[
                    var newsletterSubscriberFormDetail = new VarienForm('newsletter-validate-detail');
                    //]]>
                </script>
            </div>
            <!-- subscriber panel end-->
        
    </div>
</div>

<div class="clear"></div>



<!-- Menu Navigation -->
<div class="header-bottom " >
    <div style="width:952px;margin:0 auto;">
        <img src="<?php echo $this->getSkinUrl('images/tot_menu_bg_le.png') ?>"  width="10" height="45" alt="menuleftimg" class="floatleft"/>
        <div class="menu_middlebg">
            <ul class="clsmenuul" >

                        <li <?php if(Mage::getSingleton('cms/page')->getIdentifier() == 'home') echo 'class="active"' ; ?>><a href="<?php echo Mage::getBaseUrl(); ?>" >
                                <?php echo $this->__("TODAY'S DEAL")?></a>
                        </li>
                        <li <?php if(Mage::getSingleton('cms/page')->getIdentifier() == 'recent-deals') echo 'class="active"' ; ?>><a href="<?php echo Mage::getBaseUrl(); ?>recent-deals" >
                                <?php echo $this->__('RECENT DEALS')?></a>
                        </li>
                        <li <?php if(Mage::getSingleton('cms/page')->getIdentifier() == 'works') echo 'class="active"' ; ?>><a href="<?php echo Mage::getBaseUrl(); ?>works" >
                                <?php echo $this->__('HOW IT WORKS')?></a>
                        </li>
                        <li <?php if(Mage::getSingleton('cms/page')->getIdentifier() == 'business') echo 'class="active"' ; ?>><a href="<?php echo Mage::getBaseUrl(); ?>business" >
                               <?php echo $this->__('BUSINESS')?></a>
                        </li>
                        <li <?php if($this->helper('core/url')->getCurrentUrl() == Mage::getBaseUrl().'contacts') echo 'class="active"' ; ?>><a href="<?php echo Mage::getBaseUrl(); ?>contacts" >
                                <?php echo $this->__('CONTACT US')?></a>
                        </li>

            </ul>
            <ul class="floginul">


                <?php $loggedIn = $this->helper("customer")->isLoggedIn(); //place the output in a var ?>
                <?php
                                //  $key = Mage::app()->getRequest()->getCookie('fbs_'.Mage::getSingleton('facebook/config')->getApiKey(), false);
                                if ($loggedIn) {
                                    if (isset($_COOKIE['fbs_' . Mage::getSingleton('facebook/config')->getApiKey()])) {
                ?>
                                        <li><div id="facebookimage"></div></li>
                                        <li><a href="<?php echo Mage::getBaseUrl() . "customer/account/logout/" ?>"  title="Facebook Connect"  rel="facebook-connect"><img src="<?php echo $this->getSkinUrl('images/flogout.jpg') ?>" id="facebooklogout" class="facebooklogout" alt="facebook logout" /></a></li>

                <?php
                                    }
                                } else {
                ?>
                                    <!--li><a href="#"  title="Facebook Connect"  rel="facebook-connect"><img src="<?php echo $this->getSkinUrl('images/flogin.jpg') ?>" id="facebook" alt="facebook login" /></a></li-->
                                    <li><a href="<?php echo Mage::getBaseUrl() . "customer/account/create/" ?>"  title="Sign up" class="clsflogin"   ><?php echo $this->__('Sign Up'); ?></a></li>
                                    <li class="or"><?php echo $this->__('or'); ?></li>
                                    <li><a href="<?php echo Mage::getBaseUrl() . "customer/account/login/" ?>"  title="Sign in" class="clsflogin"   ><?php echo $this->__('Sign In'); ?></a></li>
                <?php } ?>

                            </ul>
            <div class="clear"></div>
        </div>
        <img src="<?php echo $this->getSkinUrl('images/tot_menu_bg_ri.png') ?>"  width="10" height="45" alt="menurightimg" class="floatright"/>
        <div class="clear">
        </div>
    </div>
</div>
<!-- Menu Navigation -->